package com.sychip.fhc.app.data.source.entity

import androidx.room.Entity
import com.sychip.fhc.app.data.source.dao.TBL_WsnDevice
import com.sychip.fhc.app.data.source.dao.TBL_WsnDeviceRssi
import com.sychip.fhc.app.data.source.dao.TBL_WsnRssiHis
import com.sychip.fhc.app.data.source.dao.TBL_WsnTestRecord


@Entity(
    tableName = TBL_WsnDevice,
    primaryKeys = ["usbId", "devId"]
)
data class WsnDeviceEntity(
    var usbId: String,
    var devId: String,
    var name: String = "",
    var offsetX: Float = 0f,
    var offsetY: Float = 0f,
    var lastData: String = "",
    var devType: String = "",
)


@Entity(
    tableName = TBL_WsnDeviceRssi,
    primaryKeys = ["usbId", "fromDevId", "toDevId", "dateTime"]
)
data class WsnDeviceRssiEntity(
    var usbId: String,
    var fromDevId: String,
    var toDevId: String,
    var rssi: Int = 0,
    var dateTime: Long = System.currentTimeMillis(),
)

@Entity(
    tableName = TBL_WsnTestRecord,
    primaryKeys = ["usbId","fromTime"]
)
data class WsnTestRecordEntity(
    var usbId: String,
    var projectName: String="",
    var routeName: String="",
    var imageUrl: String="",
    var fromTime:  Long = System.currentTimeMillis(),
    var toTime: Long = System.currentTimeMillis(),

)
@Entity(
    tableName = TBL_WsnRssiHis,
    primaryKeys = ["usbId", "fullRssi", "rssiType", "rssiParse", "dateTime"]
)
data class WsnRssiHisEntity(
    var usbId: String,
    var fullRssi: String="",
    var rssiType: Int = 0,
    var rssiParse: String="",
    var dateTime:  Long = System.currentTimeMillis(),

    )